package com.gxa.service.impl;

import com.gxa.pojo.Project;
import com.gxa.dao.ProjectMapper;
import com.gxa.pojo.ProjectV;
import com.gxa.pojo.ProjectVO;
import com.gxa.service.ProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service("projectService")
public class ProjectServiceImpl implements ProjectService {

   @Autowired
   ProjectMapper projectMapper;

    @Override
    public List<Project> showAllProject(ProjectV projectV) {

        List<Project> projects=projectMapper.showAllProject(projectV);

        return projects;
    }

    @Override
    public int getCount() {
        return projectMapper.getCount();
    }

    @Override
    public List<Project> selectByCondition(ProjectV projectV) {

        List<Project> projects=projectMapper.selectByCondition(projectV);
        return projects;
    }

    @Override
    public Boolean addProject(Project project) {
        int row=projectMapper.addProject(project);
        if(row>0){
            return true;
        }else {
            return false;
        }
    }

    @Override
    public Boolean deleteByProjectNumber(String projectNumber) {
        int row=projectMapper.deleteByProjectNumber(projectNumber);
        if(row>0){
            return true;
        }else {
            return false;
        }
    }

    @Override
    public Project selectByProjectNumber(String projectNumber) {
        Project project=projectMapper.selectByProjectNumber(projectNumber);
        return project;
    }
}
